<template>
	<div class="zhengtuojianhuo">
		<van-nav-bar :fixed="true" class="navBar" title="移库收货" left-arrow @click-left="$router.go(-1)"></van-nav-bar>




		<div class="goodsFromWarp">

				<div class="goodsInputWarp">
						<div class="goodsInputLabel">
							<div class="goodsInputBorder"></div>
							<div class="skuName">移入单号：</div>
						</div>
						<van-field
							 class="skuInput"
							 v-model="editForm.bill"
							 placeholder="请填写移出单号"
							 clearable
							 @keyup="onEnter($event,do_inputspbar)"
						 />

						 <div class="searchBtn">
								<button :disabled="isdisabled"  @click.stop="lingquBtn()" >
									<van-icon name="ellipsis" color="#1989fa"  />
								</button>
						 </div>
				</div>

				<div class="goodsInputWarp">
						<div class="goodsInputLabel">
							<div class="goodsInputBorder"></div>
							<div class="skuName">商品条码：</div>
						</div>
						<van-field
							 class="skuInput"
							 v-model="editForm.itemid"
							 placeholder="请填写商品条码"
							 clearable
							 @keyup="onEnter($event,do_inputspbarSku)"
						 />

						 <div class="searchBtn">
								<button :disabled="isdisabled"  @click.stop="searchGoodsBtn()" >
									<van-icon name="ellipsis" color="#1989fa"  />
								</button>
						 </div>
				</div>

				<div class="tishiMessage" style="margin-top:5px;">
					{{billRow.xs1}}
				</div>

				<div class="tishiMessage">
					{{billRow.xs2}}
				</div>




				<div class="tishiMessage" style="margin-top: 5px;">
					{{skuRow.mx1}}
				</div>

				<div class="tishiMessage">
					{{skuRow.mx2}}
				</div>

				<div class="goodsInputWarp">
						<div class="goodsInputLabel">
							<div class="goodsInputBorder"></div>
							<div class="skuName">上架仓位：</div>
						</div>
						<van-field
							 class="skuInput"
							 v-model="editForm.cwno"
							 placeholder="上架仓位"
							 clearable
						 />

						 <div class="rowBtn">
								<button @click="newsCwnoClick()">新位</button>
								<button @click="searchCwnoBtn()">旧位</button>
						 </div>
				</div>

				<div class="goodsInputWarp">
						<div class="goodsInputLabel">
							<div class="goodsInputBorder"></div>
							<div class="skuName">箱装：</div>
						</div>
						<van-field
							 class="skuInput"
							 v-model="editForm.unit"
							 placeholder="请填写箱装"
							 clearable
						 />
				</div>

				<div class="goodsInputWarp">
						<div class="goodsInputLabel">
							<div class="goodsInputBorder"></div>
							<div class="skuName">箱数：</div>
						</div>
						<van-field
							 class="skuInput"
							 v-model="editForm.pack"
							 placeholder="请填写箱数"
							 clearable
						 />
				</div>

				<div class="goodsInputWarp">
						<div class="goodsInputLabel">
							<div class="goodsInputBorder"></div>
							<div class="skuName">散数：</div>
						</div>
						<van-field
							 class="skuInput"
							 v-model="editForm.qty"
							 placeholder="请填写散数"
							 clearable
						 />
				</div>

				<div class="goodsInputWarp">
						<div class="goodsInputLabel">
							<div class="goodsInputBorder"></div>
							<div class="skuName">生产日期：</div>
						</div>


						<van-field
							 style="width:180px;"
							 @input="validateDate"
							 type="text"
							 placeholder="YYYYMMDD"
							 class="skuInputDate"
							 v-model="editForm.p_date"
							 clearable
						 />

						<!-- <div class="searchBtn">
								<button :disabled="isdisabled"  @click.stop="selectTimeBtn()" >
									<van-icon name="ellipsis" color="#1989fa"  />
								</button>
						 </div> -->
				</div>
				{{errorMessage}}
		</div>




		<div class="skuBtn">
			<van-button type="info" :disabled="isdisabled" @click="searchYiChuBtn()">查已移动</van-button>
			<van-button type="info" :disabled="isdisabled" @click="saveChuHuoBtn()">移库上架</van-button>
		</div>


		<van-overlay :show="isBillVisible" :lock-scroll="false">
			<div class="shipandanWrapper">
					<van-sticky>
						<van-nav-bar class="navBar" title="单号" left-arrow @click-left="isBillVisible = false"></van-nav-bar>
					</van-sticky>
					<div class="shipandanCon" @click.stop>
							<div  v-for="(row,i) in lingquData" :key="i" class="danjuRow" @click="selectBillClick(row,i)" >
								<van-row class="skuList" >
								  <van-col span="24"> <span>单号：</span> {{row.bill}}</van-col>
								</van-row>
								<van-row class="skuList">
									<van-col span="24"> <span>部类：</span> {{row.deptcsid}}</van-col>
								</van-row>

								<van-row class="skuList"  >
									<van-col span="24"> <span>目标库：</span> {{row.tposin}}</van-col>
								</van-row>
								<van-row class="skuList"  >
									<van-col span="24"> <span>完成：</span> {{row.yjtotqty}}</van-col>
								</van-row>
								<van-row class="skuList"  >
									<van-col span="24"> <span>预计：</span> {{row.tot}}</van-col>
								</van-row>
								<van-row class="skuList"  >
									<van-col span="24"> <span>状态：</span> {{row.status}}</van-col>
								</van-row>

								<van-row class="skuList"  >
									<van-col span="24"> <span>备注：</span> {{row.comm}}</van-col>
								</van-row>

							</div>
					</div>
			</div>
		</van-overlay>


		<van-overlay :show="isSkuVisible" :lock-scroll="false">
			<div class="shipandanWrapper">
					<van-sticky>
						<van-nav-bar class="navBar" title="移库收货单号" left-arrow @click-left="isSkuVisible = false"></van-nav-bar>
					</van-sticky>
					<div class="shipandanCon" @click.stop>
							<div  v-for="(row,i) in skuData" :key="i" class="danjuRow" @click="selectSkuClick(row,i)" >
								<van-row class="skuList" >
								  <van-col span="24"> <span>单号：</span> {{row.bill}}</van-col>
								</van-row>
								<van-row class="skuList">
									<van-col span="24"> <span>条码：</span> {{row.barcode}}</van-col>
								</van-row>

								<van-row class="skuList"  >
									<van-col span="24"> <span>商品：</span>{{row.itemid}} {{row.subsname}}</van-col>
								</van-row>
								<van-row class="skuList"  >
									<van-col span="24"> <span>预计：</span> {{row.yjtotqty}}</van-col>
								</van-row>
								<van-row class="skuList"  >
									<van-col span="24"> <span>完成：</span> {{row.tot}}</van-col>
								</van-row>
							</div>
					</div>
			</div>
		</van-overlay>


		<van-overlay :show="isCwnoVisible" :lock-scroll="false">
			<div class="shipandanWrapper">
					<van-sticky>
						<van-nav-bar class="navBar" title="单号" left-arrow @click-left="isCwnoVisible = false"></van-nav-bar>
					</van-sticky>
					<div class="shipandanCon" @click.stop>
							<div  v-for="(row,i) in cangweiTableData" :key="i" class="danjuRow" @click="selectCwnoClick(row,i)" >
									<van-row class="skuList"  >
										<van-col span="24"> <span>单号：</span> {{row.cwno}}</van-col>
									</van-row>
									<van-row class="skuList">
										<van-col span="24"> <span>箱装：</span> {{row.unit}}</van-col>
									</van-row>

									<van-row class="skuList"  >
										<van-col span="24"> <span>总库存：</span>{{row.totqty}}</van-col>
									</van-row>
									<van-row class="skuList"  >
										<van-col span="24"> <span>已分配：</span> {{row.yfpqty}}</van-col>
									</van-row>
									<van-row class="skuList"  >
										<van-col span="24"> <span>仓库：</span> {{row.whsid}}</van-col>
									</van-row>
							</div>
					</div>
			</div>
		</van-overlay>


		<van-overlay :show="isYYDVisible" :lock-scroll="false">
			<div class="shipandanWrapper">
					<van-sticky>
						<van-nav-bar class="navBar" title="已移动" left-arrow @click-left="isYYDVisible = false"></van-nav-bar>
					</van-sticky>
					<div class="shipandanCon" @click.stop>
							<div  v-for="(row,i) in yydTableData" :key="i" class="danjuRow">
									<van-row class="skuList"  >
										<van-col span="24"> <span>仓位：</span> {{row.cwno}}</van-col>
									</van-row>
									<van-row class="skuList">
										<van-col span="24"> <span>仓位总操作：</span> {{row.t_cwqty}}</van-col>
									</van-row>

									<van-row class="skuList"  >
										<van-col span="24"> <span>业务开单数：</span>{{row.t_ywqty}}</van-col>
									</van-row>
									<van-row class="skuList"  >
										<van-col span="24"> <span>箱装：</span> {{row.unit}}</van-col>
									</van-row>
									<van-row class="skuList"  >
										<van-col span="24"> <span>本仓位总：</span> {{row.totqty}}</van-col>
									</van-row>
							</div>
					</div>
			</div>
		</van-overlay>


		<van-popup v-model="isMonthshow" position="bottom" :style="{ height: '300px' }" >
		    <van-datetime-picker
		        v-model="currentMonthDate"
		        type="date"
		        title="选择年月日"
		        :min-date="minMonthDate"
		        :max-date="maxMonthDate"
		        :formatter="formatterMonth"
		        @confirm="selectMonthConfirm"
		    />
		</van-popup>

	</div>
</template>

<script>

export default {
  name: 'yikushouhuo',
  data() {
    return {
			editForm:{
				bill:'',
				itemid:'',
				cwno:'',
				totqty:'',
				whsid:'',
				yfpqty:'',
				unit: '',
				pack:'',
				qty:'',
				p_date:'',
			},
			billRow:{
				xs1: "",
				xs2: "",
			},
			isBillVisible:false,
			isdisabled:false,
			lingquData:[],
			isSkuVisible:false,
			skuData:[],
			skuRow:{
				mx1: "",
				mx2: "",
			},
			isCwnoVisible:false,
			cangweiTableData:[],
			isYYDVisible:false,
			yydTableData:[],
			currentMonthDate:'',
			minMonthDate: new Date(2020, 0, 1),
			maxMonthDate: new Date(2025, 10, 1),
			currentMonthDate: new Date(),
			isMonthshow:false,
			errorMessage:'',
		};
  },
	computed: {
		 ryuser: function(){
			 return this.GWO(true).gUSER;
		 },
	},
  methods: {
		validateDate(){
				const currentYear = new Date().getFullYear();
				this.errorMessage = '';
				this.formattedDate = '';

				if (this.editForm.p_date.length === 8) {
					 const year = this.editForm.p_date.slice(0, 4);
					 const month = this.editForm.p_date.slice(4, 6);
					 const day = this.editForm.p_date.slice(6, 8);

					 // 检查年份是否在有效范围内
					 if (year < 2000) {
						 this.errorMessage = '年份必须在2000年或之后。';
						 return;
					 }

					 // 验证月份
					 if (month < 1 || month > 12) {
						 this.errorMessage = '月份必须在1-12之间。';
						 return;
					 }

					 // 验证天数
					 if (!this.isValidDay(year, month, day)) {
						 this.errorMessage = '日期不正确，天数必须在1-31之间。';
						 return;
					 }

				 // 格式化日期
				 this.editForm.p_date = `${year}-${month}-${day}`;
				} else if (this.editForm.p_date.length === 4) {
				 const month = this.editForm.p_date.slice(0, 2);
				 const day = this.editForm.p_date.slice(2, 4);
				 const year = currentYear.toString();

				 // 检查年份是否在有效范围内
				 if (year < 2000) {
					 this.errorMessage = '年份必须在2000年或之后。';
					 return;
				 }

				 // 验证月份
				 if (month < 1 || month > 12) {
					 this.errorMessage = '月份必须在1-12之间。';
					 return;
				 }

				 // 验证天数
				 if (!this.isValidDay(year, month, day)) {
					 this.errorMessage = '日期不正确，天数必须在1-31之间。';
					 return;
				 }

				 // 格式化日期
				 this.editForm.p_date = `${year}-${month}-${day}`;
			 } else if (this.editForm.p_date.length > 0) {
				 this.errorMessage = '只能按照 YYYYMMDD 或 MMDD 格式输入。';
		  }

		},
		isValidDay(year, month, day) {
			const date = new Date(year, month - 1, day);
			return date.getFullYear() == year && date.getMonth() == month - 1 && date.getDate() == day;
		},
		do_inputspbar(pmtxt){
			console.log(pmtxt)  //扫描枪获取的参数
			this.editForm.bill = pmtxt
			this.lingquBtn()
		},
		lingquBtn(){
			var _self = this;
			var ldemodata = [{retval:0, errmsg:'返回数据集'},]
			this.MYPOST({
				'method':'dgate',
				'pname':'f_wmsa_y_pandian',
				'i':this.FNULLE([
				'opmode','Y_YKSH_qrybill',
				'czyid',this.ryuser.operatorid,
				'kqid', this.ryuser.kqid,
				'bill',this.editForm.bill,
				])
				},'移库移入查询',true, ldemodata, function(ret_obj, ret_iserr,ret_errmess,ret_oldresp){
				if(ret_iserr){ //传入的true参数,理论上不会有此回调了
					_self.$toast.fail('查询失败')
					_self.$store.commit('hideLoading');
				}else{
					var rtn_json_obj = null;
					_self.$store.commit('hideLoading');
					if(ret_obj != null){ rtn_json_obj = ret_obj; //返回的接口可以直接解析的情况
					}else{  rtn_json_obj = _self.arr2Obj(ret_oldresp.data); //非标准的dgate接口,返回的一个不兼容的处理
					}
					console.log("得到移库移入查询")
					console.log(rtn_json_obj)
					_self.lingquData = rtn_json_obj
					if(_self.lingquData.length > 0){
						_self.isBillVisible = true
					}else{
						_self.$toast.fail('暂无商品信息')
					}

				}
			});
		},
		selectBillClick(row){
			console.log(row.bill)
			this.editForm.bill = row.bill
			this.editForm.itemid = ''
			this.skuRow = {
				mx1: "",
				mx2: "",
			}
			this.editForm.unit = '',
			this.editForm.pack = '',
			this.editForm.qty = '',
			this.editForm.p_date = '',

			this.isBillVisible = false
			this._getBillItem()
		},
		_getBillItem(){
			var _self = this;
			var ldemodata = [{retval:0, errmsg:'返回数据集'},]
			this.MYPOST({
				'method':'dgate',
				'pname':'f_wmsa_y_pandian',
				'i':this.FNULLE([
				'opmode','Y_YKSH_jybill',
				'czyid',this.ryuser.operatorid,
				'kqid', this.ryuser.kqid,
				'bill',this.editForm.bill,
				])
				},'单号详情',true, ldemodata, function(ret_obj, ret_iserr,ret_errmess,ret_oldresp){
				if(ret_iserr){ //传入的true参数,理论上不会有此回调了
					_self.$toast.fail('查询失败')
					_self.$store.commit('hideLoading');
				}else{
					var rtn_json_obj = null;
					_self.$store.commit('hideLoading');
					if(ret_obj != null){ rtn_json_obj = ret_obj; //返回的接口可以直接解析的情况
					}else{  rtn_json_obj = _self.arr2Obj(ret_oldresp.data); //非标准的dgate接口,返回的一个不兼容的处理
					}
					console.log("得到单号详情查询")
					console.log(rtn_json_obj)
					_self.billRow = rtn_json_obj[0]
				}
			});
		},
		do_inputspbarSku(pmtxt){
			console.log(pmtxt)  //扫描枪获取的参数
			this.editForm.itemid = pmtxt
			this.searchGoodsBtn()
		},
		searchGoodsBtn(){
			var _self = this;
			var ldemodata = [{retval:0, errmsg:'返回数据集'},]
			this.MYPOST({
				'method':'dgate',
				'pname':'f_wmsa_y_pandian',
				'i':this.FNULLE([
				'opmode','Y_YKSH_qryitemid',
				'czyid',this.ryuser.operatorid,
				'kqid', this.ryuser.kqid,
				'bill',this.editForm.bill,
				'itemid',this.editForm.itemid,
				])
				},'商品详情',true, ldemodata, function(ret_obj, ret_iserr,ret_errmess,ret_oldresp){
				if(ret_iserr){ //传入的true参数,理论上不会有此回调了
					_self.$toast.fail('查询失败')
					_self.$store.commit('hideLoading');
				}else{
					var rtn_json_obj = null;
					_self.$store.commit('hideLoading');
					if(ret_obj != null){ rtn_json_obj = ret_obj; //返回的接口可以直接解析的情况
					}else{  rtn_json_obj = _self.arr2Obj(ret_oldresp.data); //非标准的dgate接口,返回的一个不兼容的处理
					}
					console.log("得到商品详情查询")
					console.log(rtn_json_obj)
					_self.skuData = rtn_json_obj

					if(_self.skuData.length == 0){
						_self.$toast.fail('暂无商品信息')
					}else if(_self.skuData.length == 1){
						_self.editForm.itemid = _self.skuData[0].itemid
						_self._getskuItem();
					}else{
						_self.isSkuVisible = true
					}
				}
			});
		},
		selectSkuClick(row){
			this.editForm.itemid = row.itemid
			this.isSkuVisible = false
			this._getskuItem()
		},
		_getskuItem(){
			var _self = this;
			var ldemodata = [{retval:0, errmsg:'返回数据集'},]
			this.MYPOST({
				'method':'dgate',
				'pname':'f_wmsa_y_pandian',
				'i':this.FNULLE([
				'opmode','Y_YKSH_jyitemid',
				'czyid',this.ryuser.operatorid,
				'kqid', this.ryuser.kqid,
				'bill',this.editForm.bill,
				'itemid',this.editForm.itemid,
				])
				},'商品详情',true, ldemodata, function(ret_obj, ret_iserr,ret_errmess,ret_oldresp){
				if(ret_iserr){ //传入的true参数,理论上不会有此回调了
					_self.$toast.fail('查询失败')
					_self.$store.commit('hideLoading');
				}else{
					var rtn_json_obj = null;
					_self.$store.commit('hideLoading');
					if(ret_obj != null){ rtn_json_obj = ret_obj; //返回的接口可以直接解析的情况
					}else{  rtn_json_obj = _self.arr2Obj(ret_oldresp.data); //非标准的dgate接口,返回的一个不兼容的处理
					}
					console.log("得到商品详情查询")
					console.log(rtn_json_obj)
					_self.skuRow = rtn_json_obj[0]
					_self.editForm.unit 				= _self.skuRow.unit
					_self.editForm.pack 				= _self.skuRow.pack
					_self.editForm.qty 					= _self.skuRow.qty
					if(_self.skuRow.qualityflag == 'N'){
						_self.editForm.p_date 		= _self.format_yyyyMMdd(new Date())
					}
				}
			});
		},
		selectTimeBtn(){
			this.isMonthshow = true
		},
		formatterMonth(type, val) {
		    if (type === 'year') {
		        return `${val}年`;
		    } else if (type === 'month') {
		        return `${val}月`;
		    }else if (type === 'day') {
		        return `${val}日`;
		    }
		    return val;
		},
		selectMonthConfirm(value){
				this.editForm.p_date = this.format_yyyyMMdd(value)
		    this.isMonthshow =!this.isMonthshow
		},
		newsCwnoClick(){
			var _self = this;
			var ldemodata = [{retval:0, errmsg:'返回数据集'},]
			this.MYPOST({
				'method':'dgate',
				'pname':'f_wmsa_y_pandian',
				'i':this.FNULLE([
				'opmode','Y_YKSH_n_qrycwno',
				'czyid',this.ryuser.operatorid,
				'kqid', this.ryuser.kqid,
				'bill',this.editForm.bill,
				'itemid',this.editForm.itemid,
				'cwno',this.editForm.cwno,
				])
				},'新仓位查询',true, ldemodata, function(ret_obj, ret_iserr,ret_errmess,ret_oldresp){
				if(ret_iserr){ //传入的true参数,理论上不会有此回调了
					_self.$toast.fail('查询失败')
					_self.$store.commit('hideLoading');
				}else{
					var rtn_json_obj = null;
					_self.$store.commit('hideLoading');
					if(ret_obj != null){ rtn_json_obj = ret_obj; //返回的接口可以直接解析的情况
					}else{  rtn_json_obj = _self.arr2Obj(ret_oldresp.data); //非标准的dgate接口,返回的一个不兼容的处理
					}
					console.log("得到新仓位查询查询")
					console.log(rtn_json_obj)
					_self.editForm.cwno  = rtn_json_obj[0].cwno
				}
			});
		},
		searchCwnoBtn(){
			var _self = this;
			var ldemodata = [{retval:0, errmsg:'返回数据集'},]
			this.MYPOST({
				'method':'dgate',
				'pname':'f_wmsa_y_pandian',
				'i':this.FNULLE([
				'opmode','Y_YKSH_o_qrycwno',
				'czyid',this.ryuser.operatorid,
				'kqid', this.ryuser.kqid,
				'bill',this.editForm.bill,
				'itemid',this.editForm.itemid,
				'cwno',this.editForm.cwno,
				])
				},'旧位查询',true, ldemodata, function(ret_obj, ret_iserr,ret_errmess,ret_oldresp){
				if(ret_iserr){ //传入的true参数,理论上不会有此回调了
					_self.$toast.fail('查询失败')
					_self.$store.commit('hideLoading');
				}else{
					var rtn_json_obj = null;
					_self.$store.commit('hideLoading');
					if(ret_obj != null){ rtn_json_obj = ret_obj; //返回的接口可以直接解析的情况
					}else{  rtn_json_obj = _self.arr2Obj(ret_oldresp.data); //非标准的dgate接口,返回的一个不兼容的处理
					}
					console.log("得到旧位查询")
					console.log(rtn_json_obj)
					_self.cangweiTableData = rtn_json_obj
					if(_self.cangweiTableData.length > 0){
						_self.isCwnoVisible = true
					}else{
						_self.$toast.fail('暂无仓位详情')
					}
				}
			});
		},
		selectCwnoClick(row){
			console.log(row)
			this.editForm.cwno = row.cwno
			// this.editForm.whsid = row.whsid
			this.isCwnoVisible = false
			// this._getCwnoItem()
		},
		searchYiChuBtn(){
			var _self = this;
			var ldemodata = [{retval:0, errmsg:'返回数据集'},]
			this.MYPOST({
				'method':'dgate',
				'pname':'f_wmsa_y_pandian',
				'i':this.FNULLE([
				'opmode','Y_YKSH_qryycitemid',
				'czyid',this.ryuser.operatorid,
				'kqid', this.ryuser.kqid,
				'bill',this.editForm.bill,
				'itemid',this.editForm.itemid,
				])
				},'已移动查询',true, ldemodata, function(ret_obj, ret_iserr,ret_errmess,ret_oldresp){
				if(ret_iserr){ //传入的true参数,理论上不会有此回调了
					_self.$toast.fail('查询失败')
					_self.$store.commit('hideLoading');
				}else{
					var rtn_json_obj = null;
					_self.$store.commit('hideLoading');
					if(ret_obj != null){ rtn_json_obj = ret_obj; //返回的接口可以直接解析的情况
					}else{  rtn_json_obj = _self.arr2Obj(ret_oldresp.data); //非标准的dgate接口,返回的一个不兼容的处理
					}
					console.log("得到已移动查询")
					console.log(rtn_json_obj)
					_self.yydTableData = rtn_json_obj
					if(_self.yydTableData.length > 0){
						_self.isYYDVisible = true
					}else{
						_self.$toast.fail('暂无仓位详情')
					}
				}
			});
		},
		saveChuHuoBtn(){
			if(parseInt(this.editForm.pack) == 0 && parseInt(this.editForm.qty)== 0){
				this.$dialog.confirm({
				  title: '提示',
				  message:'是否从仓位'+ this.editForm.cwno+'对商品'+this.editForm.itemid+'的移库收货上架操作？',
				}).then(() => {
					this._getSaveChuHuo()
				}).catch(() => {
				    // this.isdisabled = false
				    // this.addmode = !this.addmode
				});
			}else{
				 this._getSaveChuHuo()
			}
		},
		_getSaveChuHuo(){
			var _self = this;
			var ldemodata = [{retval:0, errmsg:'返回数据集'},]
			this.MYPOST({
				'method':'dgate',
				'pname':'f_wmsa_y_pandian',
				'i':this.FNULLE([
				'opmode','Y_YKSH_yksj',
					'czyid',this.ryuser.operatorid,
					'kqid', this.ryuser.kqid,
					'bill',this.editForm.bill,
					'itemid',this.editForm.itemid,
					'cwno',this.editForm.cwno,
					'unit',this.editForm.unit,
					'pack',this.editForm.pack,
					'qty',this.editForm.qty,
					'p_date',this.editForm.p_date,
				])
				},'移库移出保存',true, ldemodata, function(ret_obj, ret_iserr,ret_errmess,ret_oldresp){
				if(ret_iserr){ //传入的true参数,理论上不会有此回调了
					_self.$toast.fail('查询失败')
					_self.$store.commit('hideLoading');
				}else{
					var rtn_json_obj = null;
					_self.$store.commit('hideLoading');
					if(ret_obj != null){ rtn_json_obj = ret_obj; //返回的接口可以直接解析的情况
					}else{  rtn_json_obj = _self.arr2Obj(ret_oldresp.data); //非标准的dgate接口,返回的一个不兼容的处理
					}
					console.log("得到移库移出保存")
					console.log(rtn_json_obj)
					if(rtn_json_obj[0].ret_ret == '-1'){
						_self.$toast.fail(rtn_json_obj[0].ret_mess)
						return
					}else{
						_self.$toast.fail(rtn_json_obj[0].ret_mess)
              _self.editForm.itemid = ''
              _self.editForm.unit = ''
              _self.editForm.cwno = ''
              _self.editForm.totqty = ''
              _self.editForm.unit = ''
              _self.editForm.whsid = ''
              _self.editForm.yfpqty = ''
              _self.editForm.pack = ''
              _self.editForm.qty = ''
              _self.editForm.p_date = ''
						// _self.editForm = {
						// 		bill:'',

						// }
						_self.billRow = {
								xs1: "",
								xs2: "",
						}
						_self.lingquData = []
						_self.skuData = []
						_self.cangweiTableData = []
						_self.yydTableData = []
						_self.skuRow = {
								mx1: "",
								mx2: "",
						}
            _self._getBillItem()
					}
				}
			});
		},
  },
  mounted() {

  },
	components: {

	},
};
</script>

<style lang="scss" scoped>
	// 引入公共样式
	@import '@/assets/css/base.scss';
	@import '@/assets/css/input.scss';
	div.zhengtuojianhuo{
		padding-top: 50px;
	}



	div.carCardWarp{
		width: 94%;
		margin-left: 3%;
		margin-right: 3%;
		margin-top: 20px;
		font-size: 14px;
		div.carCard{
			position: relative;
			border-left: 5px solid #4998FF;
			box-sizing: border-box;
			padding-left: 10px;
			padding-right: 10px;
			border-radius:5px;
			background-color: #fff;
			padding-top: 10px;
			padding-bottom: 10px;
			margin-bottom:15px;
			div.status{
				position: absolute;
				right: 0;
				top: 0;
				width: 65px;
				height: 30px;
				display: flex;
				align-items: center;
				justify-content: center;
				color: #fff;
				font-size: 12px;
				border-radius: 0px 10px 0px 10px;
			}
			div.goodRow{
				margin-bottom:8px;
				span{
					display: inline-block;
					width:80px;
				}
			}
			div.goodsTitleRow{
				display: flex;
				width: 100%;
				div.goodsTitleLabel{
					width: 80px;
				}
				div.skuNoTitle{
					width: calc(100% - 80px);
				}
			}
		}
	}


	div.skuNamaRow{
		display: flex;
		line-height: 20px;
		margin-bottom: 10px;
		div.skuNamaRow_left{
			width:90px;
		}
	}


	div.messageWarp{
		width: 100%;
		height: 100%;
		display: flex;
		align-items: center;
		justify-content: center;
		div.messageCon{
			width:80%;
			height:320px;
			background-color: #fff;
			border-radius: 10px;
			position: relative;
			.messageTitle{
				width: 100%;
				background-color: #1989fa;
				height: 38px;
				color: #fff;
				display: flex;
				align-items: center;
				justify-content: center;
				font-size: 13px;
				border-top-right-radius: 10px;
				border-top-left-radius: 10px;
			}
			.messageHeader{
				display: flex;
				// height: 30px;
				box-sizing: border-box;
				padding:5px 5%;
				font-size: 14px;
				width: 100%;
				div.messageLabel{
					width: 80px;
				}
				div.messageValue{
					width: calc(100% - 80px);
					white-space: normal
				}
			}
			div.messageFooter{
				display: flex;
				width: 100%;
				height: 41px;
				position: absolute;
				left: 0;
				bottom: 0;
				// background-color: #1989fa;
				div{
					width: 50%;
					height: 100%;
					display: flex;
					align-items: center;
					justify-content: center;
					font-size: 12px;
				}
				div:nth-child(1){
					color: #1989fa;
				}

				div:nth-child(2){
					color: #1989fa;
				}
			}
		}
	}


	.tishiMessage{
		width: 100%;
		font-weight: bold;
		// height: 30px;
		font-size:20px;
		line-height: 35px;
	}


	.searchCwnoBtn{
		width: 200px;
		height: 30px;
		display: flex;
		button{
			margin-left: 10px;
			width: 50px;
			font-size: 12px;
			background: linear-gradient(135deg, #435EF5 0%, #68B1F9 100%);
			color: #fff;
			border: none;
			border-radius:15px;
		}
	}



	.skuInputDate{
		width:70%;
		max-width: 480px;
		background: #FFFFFF;
		border-radius: 20px;
		border: 1px solid #63A8F8;
		box-sizing: border-box;
		position: relative;
		font-size:20px;
		height: 45px;
		padding: 0 10px !important;
		display: flex;
		align-items: center;

		/deep/.van-cell__value{
			width: 100%;
			height:45px;
			input{
					width: 100%;
					height: 100%;
					font-size:20px;
			}
		}
	}

	.rowBtn{
		margin-left: 10px;
		height: 60px;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		button{
			width: 60px;
			height:28px;
			border: none;
			background:linear-gradient(135deg, #435EF5 0%, #68B1F9 100%);
			color: #fff;
			padding:4px 0px;
			font-size: 14px;
		}
	}
</style>
